cmake_minimum_required(VERSION 2.8.3)
project(pcd2las)

SET(CMAKE_BUILD_TYPE "Release")
set(CMAKE_CXX_STANDARD 11)
set(CMAKE_CXX_STANDARD_REQUIRED ON)
set(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/bin)

#set(BOOST_ROOT "/usr/include/boost")
# set(libLAS_ROOT "/usr/local/lib/cmake/liblas")

find_package(Boost 1.71.0 REQUIRED COMPONENTS  filesystem date_time iostreams serialization program_options thread)
if(NOT Boost_FOUND)
    message(FATAL_ERROR "Boost库未找到")
endif()

# 查找所需的包
find_package(catkin REQUIRED COMPONENTS
  roscpp
  rospy
  std_msgs
)
find_package(PCL REQUIRED)
find_package(libLAS REQUIRED)


find_package(GDAL REQUIRED)

# 声明catkin包
catkin_package(
  INCLUDE_DIRS include
  CATKIN_DEPENDS roscpp rospy std_msgs
)

# 包含头文件目录
include_directories(
  ${catkin_INCLUDE_DIRS}
  ${PROJECT_SOURCE_DIR}/include
  ${PCL_INCLUDE_DIRS}
  ${libLAS_INCLUDE_DIRS}
  ${Boost_INCLUDE_DIRS}

  ${GDAL_INCLUDE_DIR}
)

# 添加可执行文件并链接库
# add_executable(las2pcd src/las2pcd.cpp)
# target_link_libraries(las2pcd ${libLAS_LIBRARIES} ${PCL_LIBRARIES} ${catkin_LIBRARIES})

add_executable(pcd2las src/pcd2las.cpp)
target_link_libraries(pcd2las ${libLAS_LIBRARIES} ${PCL_LIBRARIES} ${catkin_LIBRARIES} ${Boost_LIBRARIES} ${GDAL_LIBRARIES})
